Manages the scripts available in the component. More...
Public Member Functions | |
Script * | createOrRetrieve (const nkMemory::StringView &name) |
Script * | get (const nkMemory::StringView &name) |
Script * | getByIndex (unsigned int id) |
void | rename (const nkMemory::StringView ¤tName, const nkMemory::StringView &newName) |
void | erase (const nkMemory::StringView &name) |
Manages the scripts available in the component.
The manager always owns the memory allocated through it. External code should never call delete on memory retrieved through it.
Script* nkScripts::ScriptManager::createOrRetrieve | ( | const nkMemory::StringView & | name | ) |
Creates if unavailable, or retrieves if available, a script given its name.
name | The name of the script to create or retrieve. |
Script* nkScripts::ScriptManager::get | ( | const nkMemory::StringView & | name | ) |
Gets an existing script.
name | The name of the script to retrieve. |
Script* nkScripts::ScriptManager::getByIndex | ( | unsigned int | id | ) |
Gets a script according to an index.
id | The index to search for. |
void nkScripts::ScriptManager::rename | ( | const nkMemory::StringView & | currentName, |
const nkMemory::StringView & | newName | ||
) |
Renames a script within memory.
currentName | The current name to find back the script to alter. |
newName | The new name to assign to the script. |
void nkScripts::ScriptManager::erase | ( | const nkMemory::StringView & | name | ) |
Erases a script, and free its memory.
name | The name of the script to erase. |